package proyecto.testcasetool.provider.scenarios;

import java.util.Collection;

import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;

import proyecto.testcasetool.provider.AlternativeFlowItemProvider;

public class AlternativeFlowItemProviderScenarios extends AlternativeFlowItemProvider {

	public AlternativeFlowItemProviderScenarios(AdapterFactory adapterFactory) {
		super(adapterFactory);
	}
	
	@Override
	public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
		if (childrenFeatures == null) {
			super.getChildrenFeatures(object);
			//childrenFeatures.remove(TestcasetoolPackage.Literals.USE_CASE__POS_CONDITION);
			//childrenFeatures.remove(TestcasetoolPackage.Literals.USE_CASE__PRE_CONDITION);
		}
		return childrenFeatures;
	}

	@Override
	public Object getParent(Object object) {
		Object useCase = super.getParent(object);
		UseCaseItemProviderScenarios useCaseItemProviderScenarios =
		(UseCaseItemProviderScenarios)adapterFactory.adapt(
		useCase, IEditingDomainItemProvider.class);
		return useCaseItemProviderScenarios != null ?
				useCaseItemProviderScenarios.getAlternatives() : null;
	}
	
	@Override
	protected Command createRemoveCommand(EditingDomain domain, EObject owner,
			EStructuralFeature feature, Collection<?> collection) {
		
		return super.createRemoveCommand(domain, owner, feature, collection);
	}
	
}
